package com.code.refactoring.重构demo.状态机扭转.entity;

import com.code.refactoring.重构demo.状态机扭转.OrderStateEvent;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @author wangxi03 created on 2021/4/29 10:30 上午
 * @version v1.0
 */
@Setter
@Getter
@NoArgsConstructor
public class StateContext<C> {
    /**
     * 订单操作事件
     */
    private OrderStateEvent orderStateEvent;
    /**
     * 状态机需要的订单基本信息
     */
    private OrderInfo orderInfo;
    /**
     * 业务可定义的上下文泛型对象
     */
    private C context;

    public StateContext(OrderStateEvent orderStateEvent, OrderInfo orderInfo) {
        this.orderStateEvent = orderStateEvent;
        this.orderInfo = orderInfo;
    }
}
